package com.today.cjl.sqlGen.enums

/**
  * Created by cjl at 2018-09-05
  * Description: 
  * Changed: 
  */
object ArgsType extends Enumeration {
  type ArgsType = Value  // 声明枚举对外暴露的类型

  val STRING, INT, LONG, DOUBLE, BOOLEAN = Value

  def convert(value: String, argsType: ArgsType): Any = {
    argsType match {
      case INT => value.toInt
      case LONG => value.toLong
      case DOUBLE => value.toDouble
      case BOOLEAN => value.toBoolean
      case _ => value.toString
    }
  }
}

//sealed trait ArgsType
//case object STRING extends ArgsType
//case object INT extends ArgsType
//case object LONG extends ArgsType
//case object DOUBLE extends ArgsType
//case object BOOLEAN extends ArgsType
